from django.db import models
from personal_manage.models import MyUser
from goods.models import Good
# Create your models here.
class Message(models.Model):

    Mid = models.AutoField('消息编号',primary_key=True)
    Sender_id = models.ForeignKey(MyUser, on_delete=models.CASCADE, related_name='send_messages', verbose_name='发送者ID')
    Receiver_id = models.ForeignKey(MyUser, on_delete=models.CASCADE, related_name='received_messages', verbose_name='接收者ID')
    content = models.TextField('内容')
    msg_type = models.SmallIntegerField('内容类型')#TinyInt
    send_time = models.DateTimeField('发送时间')
    if_read = models.SmallIntegerField('是否已读',default=0)
    
    class Meta:
        db_table = 'msg' 